<?php 
/**
 * File: View - Grupos - index.phtml
 */
?>
			<div class="page-title ui-widget-content ui-corner-all">
				<div>
						<div class="float-left">
							<br />
							<h1><?php echo $this->moduleTitle ?></h1>
						</div>
						<div class="button float-right">
							<a href="/third/grupos/add"  class="btn ui-state-default"><span class="ui-icon ui-icon-circle-plus"></span>Adicionar novo</a>
						</div>
						<div class="clearfix"></div>
				</div>

				<div id="main-itens-content" class="hastable other" >

				<?php echo($this->flashMessages()); ?>

				<form name="listFormGrupos" class="pager-form" method="post" action="/third/grupos">
				<?php 
					if( $this->grupos['records'] ){
				?>
				<div>

					<?php include("search.phtml"); ?>
					<div class="clearfix"></div>

				</div>
				
					<table  id="gridgrupos" class="sort-table">
						<thead> 
							<tr>
								<th width="5"><input type="checkbox" value="check_none" onclick="this.value=check( this.form.list )" class="submit"/></th>
								<?php
								
									foreach( $this->grupos['headers'] as $col ){
										$width = "";
										if( isset($col['width']) )
											$width = 'width:'.$col['width'].'px;';
										if( $col != 'fullData')
											echo '<th style="'.$width.' ">'.$col['name'].'</th>';
									}
								?>
							</tr> 
						</thead> 
						<tbody> 
								<?php
									foreach( $this->grupos['data'] as $col ){
										echo '<tr>';
										echo "<td> <input type='checkbox' value='".$col['nivel']."' name='list' class='checkbox' /> </td>";
										foreach( $col as $key=>$data ){
											if( $key != 'fullData'){
													echo '<td>'.$data.'</td>';
											}
										}
										echo '</tr>';
									}
								?>
						</tbody>
					</table>


				<?php 
					} else {
						echo "Nenhum item encontrado.";
					}
				?>
				</form>
				</div>
					
				<div class="clearfix"></div>
			</div>
